<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>登陆</title>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="../static/css/bootstrap.min.css"/>

    <!-- 可选的Bootstrap主题文件（一般不用引入） -->
    <link rel="stylesheet" href="../static/css/bootstrap-theme.min.css"/>

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="../static/js/jquery-min.js"></script>
    <script src="../static/js/bootstrap.min.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.0/html5shiv.js"/>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"/>
    <![endif]-->
    <style>
        #centerRow {
            width: 30%;
            margin: 10% auto;
        }
    </style>
</head>
<body>
<div class="row text-center" id="centerRow">
    <div class="col-md-12">
        <h1>People Pen</h1>
    </div>
    <form class="form-horizontal" role="form" th:action="@{/login}" th:method="post">
        <div class="form-group" id="text_group" >
            <label for="inputEmail3" class="sr-only">account</label>
            <div class="col-sm-12">
                <input type="text" th:name="account" class="form-control" id="inputEmail3" placeholder="账号"/>
            </div>
        </div>
        <div class="form-group" id="password_group">
            <label for="inputPassword3" class="sr-only">Password</label>
            <div class="col-sm-12">
                <input type="password" th:name="password" class="form-control" id="inputPassword3" placeholder="密码"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-5">
                <div class="checkbox">
                    <label>
                        <input type="checkbox"/> 记住我
                    </label>
                </div>
            </div>
            <div class="col-sm-7 text-right">
                <button type="submit" class="btn btn-default">登陆</button>
            </div>
        </div>
    </form>
</div>
<script th:inline="javascript">
    var result = [[${result}]];
    if(result.statusCode === 10002) {
        $('#text_group').addClass("has-error");
        $('#inputEmail3').val(result.statusMessage);
    }
</script>
</body>
</html>